Skip to content

[DirectX] Use "texture" not "SRV" when pretty printing resources #130230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

bogner
Copy link
Contributor

@bogner bogner commented Mar 7, 2025

We're printing "SRV" here when DXC would print "texture". Fix this to be consistent.

Fixes #130227.

We're printing "SRV" here when DXC would print "texture". Fix this to be
consistent.

Fixes llvm#130227.
@llvmbot
Copy link
Member

llvmbot commented Mar 7, 2025

@llvm/pr-subscribers-backend-directx

Author: Justin Bogner (bogner)

Changes

We're printing "SRV" here when DXC would print "texture". Fix this to be consistent.

Fixes #130227.


Full diff: https://github.com/llvm/llvm-project/pull/130230.diff

3 Files Affected:

  • (modified) llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp (+1-1)
  • (modified) llvm/test/CodeGen/DirectX/CreateHandle.ll (+4-4)
  • (modified) llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll (+4-4)
diff --git a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
index 7255a9be06d51..83ec574bb5870 100644
--- a/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
+++ b/llvm/lib/Target/DirectX/DXILPrettyPrinter.cpp
@@ -23,7 +23,7 @@ using namespace llvm;
 static StringRef getRCName(dxil::ResourceClass RC) {
   switch (RC) {
   case dxil::ResourceClass::SRV:
-    return "SRV";
+    return "texture";
   case dxil::ResourceClass::UAV:
     return "UAV";
   case dxil::ResourceClass::CBuffer:
diff --git a/llvm/test/CodeGen/DirectX/CreateHandle.ll b/llvm/test/CodeGen/DirectX/CreateHandle.ll
index c4e02fb02733d..048e57c091142 100644
--- a/llvm/test/CodeGen/DirectX/CreateHandle.ll
+++ b/llvm/test/CodeGen/DirectX/CreateHandle.ll
@@ -3,10 +3,10 @@
 
 ; CHECK-PRETTY:       Type  Format         Dim      ID      HLSL Bind     Count
 ; CHECK-PRETTY: ---------- ------- ----------- ------- -------------- ---------
-; CHECK-PRETTY:        SRV     f32         buf      T0      t7        unbounded
-; CHECK-PRETTY:        SRV    byte         r/o      T1      t8,space1         1
-; CHECK-PRETTY:        SRV  struct         r/o      T2      t2,space4         1
-; CHECK-PRETTY:        SRV     u32         buf      T3      t3,space5        24
+; CHECK-PRETTY:    texture     f32         buf      T0      t7        unbounded
+; CHECK-PRETTY:    texture    byte         r/o      T1      t8,space1         1
+; CHECK-PRETTY:    texture  struct         r/o      T2      t2,space4         1
+; CHECK-PRETTY:    texture     u32         buf      T3      t3,space5        24
 ; CHECK-PRETTY:        UAV     i32         buf      U0      u7,space2         1
 ; CHECK-PRETTY:        UAV     f32         buf      U1      u5,space3         1
 
diff --git a/llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll b/llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll
index 9919a3f2dbd25..089b6eaa563ca 100644
--- a/llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll
+++ b/llvm/test/CodeGen/DirectX/CreateHandleFromBinding.ll
@@ -3,10 +3,10 @@
 
 ; CHECK-PRETTY:       Type  Format         Dim      ID      HLSL Bind     Count
 ; CHECK-PRETTY: ---------- ------- ----------- ------- -------------- ---------
-; CHECK-PRETTY:        SRV     f32         buf      T0      t7        unbounded
-; CHECK-PRETTY:        SRV    byte         r/o      T1      t8,space1         1
-; CHECK-PRETTY:        SRV  struct         r/o      T2      t2,space4         1
-; CHECK-PRETTY:        SRV     u32         buf      T3      t3,space5        24
+; CHECK-PRETTY:    texture     f32         buf      T0      t7        unbounded
+; CHECK-PRETTY:    texture    byte         r/o      T1      t8,space1         1
+; CHECK-PRETTY:    texture  struct         r/o      T2      t2,space4         1
+; CHECK-PRETTY:    texture     u32         buf      T3      t3,space5        24
 ; CHECK-PRETTY:        UAV     i32         buf      U0      u7,space2         1
 ; CHECK-PRETTY:        UAV     f32         buf      U1      u5,space3         1
 ; CHECK-PRETTY:    cbuffer      NA          NA     CB0            cb0         1

Copy link
Member

@hekota hekota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@alsepkow alsepkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bogner bogner merged commit d2d052b into llvm:main Mar 13, 2025
14 checks passed
bogner added a commit that referenced this pull request Mar 13, 2025
frederik-h pushed a commit to frederik-h/llvm-project that referenced this pull request Mar 18, 2025
…m#130230)

We're printing "SRV" here when DXC would print "texture". Fix this to be
consistent.

Fixes llvm#130227.
frederik-h pushed a commit to frederik-h/llvm-project that referenced this pull request Mar 18, 2025
@damyanp damyanp moved this to Closed in HLSL Support Apr 25, 2025
@damyanp damyanp removed this from HLSL Support Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HLSL] Resource binding table mismatched type string for SRV resources
4 participants